<template>
	<view class="modify">
		<!-- 头部 -->
		<!-- #ifndef MP-WEIXIN -->
		<public-header :title="title" :share="false"></public-header>
		<view class="hei_100"></view>
		 <!-- #endif -->
		<!-- end -->
		
		<public-order v-if="detail" :modify="modify" :detail="detail" :ticket="ticket"></public-order>
	</view>
</template>

<script>
	import { mapState, mapMutations } from 'vuex';
	import PublicHeader from '@/components/PublicHeader.vue';
	import PublicOrder from '@/components/PublicOrder.vue';
	export default {
		computed: mapState(['hasLogin', 'uerInfo']),
		components: {
			PublicHeader,
			PublicOrder
		},
		data() {
			return {
				title: '已接单，请支付',
				modify:true,
				detail: '',
				ticket: '',
				share: ''
			}
		},
		onLoad(){
			var _this = this;
			if (_this.hasLogin) {
				_this.$http
					.get('/user/order/vieworderdetail/' + _this.$Route.query.uid)
					.then(function(response) {
						console.log('个人信息', response);
						_this.detail = response.data
						console.log(_this.detail,"获取个人信息的同时获取到我的优惠券")
					})
					.catch(function(error) {
						console.log(error);
					});
					
				// 优惠券
				_this.$http
					.get('/personal/center/getusercoupons/' + _this.uerInfo.userId)
					.then(function(response) {
						console.log(response,"-----")
						_this.ticket = response.data;
					})
					.catch(function(error) {
						console.log(error);
					});
			}
			
		},
		methods: {
			
		}
	}
</script>

<style scoped lang="scss">

</style>
